function [d, pi] = find_shortest_paths(G, s, adjacency_matrix)

colour = zeros(1, length(G));
%d = inf * ones(1, length(G));
%pi = inf * ones(1, length(G));

enqueued = [];
dequeued = [];

allExSource = setdiff(G, s)
for  i = 1:length(allExSource)
    u = allExSource(i);
    colour(u) = 0;
    d{u} = [];
    pi{u} = [];
end

colour(s) = 1;
d{s} = [d{s} 0];
pi{s} = inf;

enqueued = [enqueued s];
while length(setdiff(enqueued, dequeued)) ~= 0
    indexOfNodeToDequeue = length(dequeued) + 1;
    u = enqueued(indexOfNodeToDequeue);
    dequeued = [dequeued u];
    
    neighbours = get_neighbour_nodes(adjacency_matrix, u);
    for i=1:length(neighbours)
        neighbourToAnalyze = neighbours(i);
        if colour(neighbourToAnalyze) ~= 2 & length(d{neighbourToAnalyze}) < 10  
            %colour(neighbourToAnalyze) = 1;
            for j=1:length(d{u})
                d{neighbourToAnalyze} = [d{neighbourToAnalyze} d{u}(j)+1];
            end
            for j=1:length(pi{u})
                if (length(pi{neighbourToAnalyze})>0)
                    for k=1:length(pi{neighbourToAnalyze})
                        pi{neighbourToAnalyze}(k) = [pi{neighbourToAnalyze}(k) u];
                    end
                else
                    pi{neighbourToAnalyze}(1) = [u];
                end
            end
            if (~any(enqueued(:) == neighbourToAnalyze))
                enqueued = [enqueued neighbourToAnalyze];
            end
        end
    end
    %colour(u) = 2; 
end
   
end
